<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BabyOS: b_w25x.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="2.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">BabyOS
   &#160;<span id="projectnumber">V0.0.2</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',false,false,'search.php','Search');
});
/* @license-end */</script>
<div id="main-nav"></div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_b9223522bb56aee4ab59f7ba381d2163.html">bos</a></li><li class="navelem"><a class="el" href="dir_bd0e78931a998067c69a2f2b1c188ef6.html">drivers</a></li><li class="navelem"><a class="el" href="dir_a2fcf4aae5087025318b36ee58bb1815.html">inc</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">b_w25x.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="b__w25x_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="preprocessor">#ifndef __B_W25X_H__</span></div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="preprocessor">#define __B_W25X_H__</span></div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;</div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="preprocessor">#ifdef __cplusplus</span></div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160; <span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> {</div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="comment">/*Includes ----------------------------------------------*/</span></div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="b__config_8h.html">b_config.h</a>&quot;</span> </div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="b__device_8h.html">b_device.h</a>&quot;</span></div><div class="line"><a name="l00055"></a><span class="lineno"><a class="line" href="group___w25_x___exported___types_definitions.html#gadda45650bf6c5ce0216af3f25bb453dc">   55</a></span>&#160;<span class="keyword">typedef</span> <a class="code" href="structb_driver_interface__t.html">bDriverInterface_t</a> <a class="code" href="group___w25_x___exported___types_definitions.html#gadda45650bf6c5ce0216af3f25bb453dc">bW25X_Driver_t</a>;  </div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;</div><div class="line"><a name="l00065"></a><span class="lineno"><a class="line" href="group___w25_x___exported___defines.html#gafe05e14fee7754524c66b25d6b242dd9">   65</a></span>&#160;<span class="preprocessor">#define W25X_PAGE_SIZE                0X100     </span></div><div class="line"><a name="l00066"></a><span class="lineno"><a class="line" href="group___w25_x___exported___defines.html#ga128f8ddbc194d58e29f22bd99787ac14">   66</a></span>&#160;<span class="preprocessor">#define W25X_SECTOR_SIZE              ((uint32_t)0X1000)    </span></div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;</div><div class="line"><a name="l00068"></a><span class="lineno"><a class="line" href="group___w25_x___exported___defines.html#ga6b291355fa27a76d8d5ea0e9c5650266">   68</a></span>&#160;<span class="preprocessor">#define W25X_WRITEENABLE              0X06      </span></div><div class="line"><a name="l00069"></a><span class="lineno"><a class="line" href="group___w25_x___exported___defines.html#gaaf0377cbabe7ea71a6ddc3f0bb20452a">   69</a></span>&#160;<span class="preprocessor">#define W25X_WRITEDISABLE             0X04      </span></div><div class="line"><a name="l00070"></a><span class="lineno"><a class="line" href="group___w25_x___exported___defines.html#ga48ec90c473b58bcd5c80d58ce50c94ff">   70</a></span>&#160;<span class="preprocessor">#define W25X_READSTATUSREG            0X05      </span></div><div class="line"><a name="l00071"></a><span class="lineno"><a class="line" href="group___w25_x___exported___defines.html#gaacd4fb074e82ca2bc5c61111b7c58fba">   71</a></span>&#160;<span class="preprocessor">#define W25X_WRITESTATUSREG           0X01  </span></div><div class="line"><a name="l00072"></a><span class="lineno"><a class="line" href="group___w25_x___exported___defines.html#ga431a55943c254095e35bcda2996f5441">   72</a></span>&#160;<span class="preprocessor">#define W25X_READDATA                 0X03      </span></div><div class="line"><a name="l00073"></a><span class="lineno"><a class="line" href="group___w25_x___exported___defines.html#ga22b7a3c2d9ba8d4c7f14f0da7a0bbe25">   73</a></span>&#160;<span class="preprocessor">#define W25X_FASTREADDATA             0X0B      </span></div><div class="line"><a name="l00074"></a><span class="lineno"><a class="line" href="group___w25_x___exported___defines.html#gacdebd2c7222448f6f65212f5ca211786">   74</a></span>&#160;<span class="preprocessor">#define W25X_FASTREADDUAL             0X3B       </span></div><div class="line"><a name="l00075"></a><span class="lineno"><a class="line" href="group___w25_x___exported___defines.html#gae35a7c28ebbb87e7fa95f50d947edd14">   75</a></span>&#160;<span class="preprocessor">#define W25X_PAGEPROGRAM              0X02      </span></div><div class="line"><a name="l00076"></a><span class="lineno"><a class="line" href="group___w25_x___exported___defines.html#ga45492dfdb1827757a822c927a174d8f4">   76</a></span>&#160;<span class="preprocessor">#define W25X_BLOCKERASE               0XD8  </span></div><div class="line"><a name="l00077"></a><span class="lineno"><a class="line" href="group___w25_x___exported___defines.html#ga156b489b4a73d10109c628f476ae2cba">   77</a></span>&#160;<span class="preprocessor">#define W25X_SECTORERASE              0X20      </span></div><div class="line"><a name="l00078"></a><span class="lineno"><a class="line" href="group___w25_x___exported___defines.html#ga3d3b6b5fd9a144adc4ec9bcb386a627a">   78</a></span>&#160;<span class="preprocessor">#define W25X_CHIPERASE                0XC7      </span></div><div class="line"><a name="l00079"></a><span class="lineno"><a class="line" href="group___w25_x___exported___defines.html#ga6f86a39788602b78340644f18290cd10">   79</a></span>&#160;<span class="preprocessor">#define W25X_POWERDOWN                0XB9      </span></div><div class="line"><a name="l00080"></a><span class="lineno"><a class="line" href="group___w25_x___exported___defines.html#ga0f09d17a66f22044a9dfe6a246cf167e">   80</a></span>&#160;<span class="preprocessor">#define W25X_RELEASEPOWERDOWN         0XAB      </span></div><div class="line"><a name="l00081"></a><span class="lineno"><a class="line" href="group___w25_x___exported___defines.html#ga7c22604b247e086479546f037c05f858">   81</a></span>&#160;<span class="preprocessor">#define W25X_DEVICEID                 0XAB      </span></div><div class="line"><a name="l00082"></a><span class="lineno"><a class="line" href="group___w25_x___exported___defines.html#ga3e51926247deb7872af9a6cec379ff54">   82</a></span>&#160;<span class="preprocessor">#define W25X_MANUFACTDEVICEID         0X90      </span></div><div class="line"><a name="l00083"></a><span class="lineno"><a class="line" href="group___w25_x___exported___defines.html#ga9c170ec2cc6fa5c861da3904d172decc">   83</a></span>&#160;<span class="preprocessor">#define W25X_JEDECDEVICEID            0X9F </span></div><div class="line"><a name="l00084"></a><span class="lineno"><a class="line" href="group___w25_x___exported___defines.html#gadb9039720fb57d30cdc8d354a8af7447">   84</a></span>&#160;<span class="preprocessor">#define W25X_READUNIQUEID             0X4B      </span></div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;</div><div class="line"><a name="l00086"></a><span class="lineno"><a class="line" href="group___w25_x___exported___defines.html#gaa9df975381b4e2212f1c8533004692a5">   86</a></span>&#160;<span class="preprocessor">#define W25X_RESETENABLE              0X66</span></div><div class="line"><a name="l00087"></a><span class="lineno"><a class="line" href="group___w25_x___exported___defines.html#ga81564d5cbdfcc61df0f8ac9519630ffd">   87</a></span>&#160;<span class="preprocessor">#define W25X_RESETCMD                 0X99</span></div><div class="line"><a name="l00088"></a><span class="lineno"><a class="line" href="group___w25_x___exported___defines.html#ga48091a4d280b9da4d009473c6c7138fb">   88</a></span>&#160;<span class="preprocessor">#define WIP_FLAG                      0X01      </span></div><div class="line"><a name="l00089"></a><span class="lineno"><a class="line" href="group___w25_x___exported___defines.html#ga4cfcccbaabe71c0fe356845dbc77a93b">   89</a></span>&#160;<span class="preprocessor">#define WEL_FLAG                      0X02     </span></div><div class="line"><a name="l00090"></a><span class="lineno"><a class="line" href="group___w25_x___exported___defines.html#gadc81a065700d3af56b6fb631585e3641">   90</a></span>&#160;<span class="preprocessor">#define DUMMY_BYTE                    0XFF  </span></div><div class="line"><a name="l00091"></a><span class="lineno"><a class="line" href="group___w25_x___exported___defines.html#ga2210f7e5ac7720dda5701affa27f2390">   91</a></span>&#160;<span class="preprocessor">#define W25X_Enable4ByteAddr          0xB7</span></div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;</div><div class="line"><a name="l00093"></a><span class="lineno"><a class="line" href="group___w25_x___exported___defines.html#ga8c951b80f979d8db6eb54a7f326eca2a">   93</a></span>&#160;<span class="preprocessor">#define W25X_ReadStatusReg1           0x05 </span></div><div class="line"><a name="l00094"></a><span class="lineno"><a class="line" href="group___w25_x___exported___defines.html#ga4f040641a4c2a63468dd376291f59518">   94</a></span>&#160;<span class="preprocessor">#define W25X_ReadStatusReg2           0x35 </span></div><div class="line"><a name="l00095"></a><span class="lineno"><a class="line" href="group___w25_x___exported___defines.html#gafabcd6a9a57130217d91673d9821005e">   95</a></span>&#160;<span class="preprocessor">#define W25X_ReadStatusReg3           0x15 </span></div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;</div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;</div><div class="line"><a name="l00098"></a><span class="lineno"><a class="line" href="group___w25_x___exported___defines.html#ga8446738dd1b4b2f009d9f9ac76e4f1fc">   98</a></span>&#160;<span class="preprocessor">#define WinbondID                     0xEF</span></div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;</div><div class="line"><a name="l00100"></a><span class="lineno"><a class="line" href="group___w25_x___exported___defines.html#gabbd77b02695cf2d0c6e0ff52ec9af93c">  100</a></span>&#160;<span class="preprocessor">#define W25Q80          ((uint16_t)0X0013)  </span></div><div class="line"><a name="l00101"></a><span class="lineno"><a class="line" href="group___w25_x___exported___defines.html#ga6869d6cf138e4ddb4e07cd8d41c21318">  101</a></span>&#160;<span class="preprocessor">#define W25Q16          ((uint16_t)0X0014) </span></div><div class="line"><a name="l00102"></a><span class="lineno"><a class="line" href="group___w25_x___exported___defines.html#ga723a6cfddec80ee349e67620fc5ddfca">  102</a></span>&#160;<span class="preprocessor">#define W25Q32          ((uint16_t)0X0015) </span></div><div class="line"><a name="l00103"></a><span class="lineno"><a class="line" href="group___w25_x___exported___defines.html#gabd6e5e44961f152076aa7a92211eea8d">  103</a></span>&#160;<span class="preprocessor">#define W25Q64          ((uint16_t)0X0016) </span></div><div class="line"><a name="l00104"></a><span class="lineno"><a class="line" href="group___w25_x___exported___defines.html#ga00da1b8574780a02ac048860e77c3e45">  104</a></span>&#160;<span class="preprocessor">#define W25Q128         ((uint16_t)0X0017)</span></div><div class="line"><a name="l00105"></a><span class="lineno"><a class="line" href="group___w25_x___exported___defines.html#gaa515df81c8800e36366e343387468376">  105</a></span>&#160;<span class="preprocessor">#define W25Q256         ((uint16_t)0X0018)</span></div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;</div><div class="line"><a name="l00117"></a><span class="lineno"><a class="line" href="group___w25_x___exported___macros.html#ga05debc44fe5eab12190f9cd6983ff8b4">  117</a></span>&#160;<span class="preprocessor">#define bW25X_ID_IS_VALID(n)    (n == W25Q80 || n == W25Q16 || n == W25Q32 || \</span></div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;<span class="preprocessor">                                 n == W25Q64 || n == W25Q128 || n == W25Q256)</span></div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;</div><div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;<span class="keyword">extern</span> <a class="code" href="structb_driver_interface__t.html">bW25X_Driver_t</a> <a class="code" href="group___w25_x___exported___variables.html#gaf32f0de405f6f704a717654d70349629">bW25X_Driver</a>;   </div><div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;<span class="keywordtype">int</span> <a class="code" href="group___w25_x___exported___functions.html#gaf21a484dde17ecbe3be7b7ce034325e7">bW25X_Init</a>(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;</div><div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;<span class="preprocessor">#ifdef __cplusplus</span></div><div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;    }</div><div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160; </div><div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;</div><div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;</div><div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;<span class="comment">/************************ Copyright (c) 2019 Bean *****END OF FILE****/</span></div><div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;</div><div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;</div><div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;</div><div class="ttc" id="structb_driver_interface__t_html"><div class="ttname"><a href="structb_driver_interface__t.html">bDriverInterface_t</a></div><div class="ttdef"><b>Definition:</b> <a href="b__device_8h_source.html#l00073">b_device.h:73</a></div></div>
<div class="ttc" id="b__config_8h_html"><div class="ttname"><a href="b__config_8h.html">b_config.h</a></div></div>
<div class="ttc" id="b__device_8h_html"><div class="ttname"><a href="b__device_8h.html">b_device.h</a></div></div>
<div class="ttc" id="group___w25_x___exported___types_definitions_html_gadda45650bf6c5ce0216af3f25bb453dc"><div class="ttname"><a href="group___w25_x___exported___types_definitions.html#gadda45650bf6c5ce0216af3f25bb453dc">bW25X_Driver_t</a></div><div class="ttdeci">bDriverInterface_t bW25X_Driver_t</div><div class="ttdef"><b>Definition:</b> <a href="b__w25x_8h_source.html#l00055">b_w25x.h:55</a></div></div>
<div class="ttc" id="group___w25_x___exported___functions_html_gaf21a484dde17ecbe3be7b7ce034325e7"><div class="ttname"><a href="group___w25_x___exported___functions.html#gaf21a484dde17ecbe3be7b7ce034325e7">bW25X_Init</a></div><div class="ttdeci">int bW25X_Init(void)</div><div class="ttdef"><b>Definition:</b> <a href="b__w25x_8c_source.html#l00391">b_w25x.c:391</a></div></div>
<div class="ttc" id="group___w25_x___exported___variables_html_gaf32f0de405f6f704a717654d70349629"><div class="ttname"><a href="group___w25_x___exported___variables.html#gaf32f0de405f6f704a717654d70349629">bW25X_Driver</a></div><div class="ttdeci">bW25X_Driver_t bW25X_Driver</div><div class="ttdef"><b>Definition:</b> <a href="b__w25x_8c_source.html#l00097">b_w25x.c:97</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.14
</small></address>
</body>
</html>
